home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 4.7 KB | 128 lines | [TEXT/MPS ] |
- ;
- ; File: ConditionalMacros.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
- __CONDITIONALMACROS__ SET 1
-
- ;
- ; This file sets up the following compiler independent conditionals:
- ;
- ; GENERATINGPOWERPC - Compiler is generating PowerPC instructions
- ; GENERATING68K - Compiler is generating 68k family instructions
- ; GENERATING68881 - Compiler is generating mc68881 floating point instructions
- ; GENERATINGCFM - Code being generated assumes CFM calling conventions
- ; CFMSYSTEMCALLS - No A-traps. Systems calls are made using CFM and UPP's
- ;
- ; SystemSevenFiveOrLater - Compiled code will only be run on a System 7.5 or later Macintosh
- ; SystemSevenOrLater - Compiled code will only be run on a System 7.0 or later Macintosh
- ; SystemSixOrLater - Compiled code will only be run on a System 6.0 or later Macintosh
- ; A developer should set the appropriate flag on the compiler command-
- ; line or in a file processed before this file. This will allow the
- ; certain optimizations to be made which can result in smaller, faster
- ; applications.
- ;
- ; CGLUESUPPORTED - Interface library will support "C glue" functions (function names
- ; are: all lowercase, use C strings instead of pascal strings, use
- ; Point* instead of Point).
- ;
- ; OLDROUTINENAMES - "Old" names for Macintosh system calls are allowed in source code.
- ; (e.g. DisposPtr instead of DisposePtr). The names of system routine
- ; are now more sensitive to change because CFM binds by name. In the
- ; past, system routine names were compiled out to just an A-Trap.
- ; Macros have been added that each map an old name to its new name.
- ; This allows old routine names to be used in existing source files,
- ; but the macros only work if OLDROUTINENAMES is true. This support
- ; will be removed in the near future. Thus, all source code should
- ; be changed to use the new names! You can set OLDROUTINENAMES to false
- ; to see if your code has any old names left in it.
- ;
- ; OLDROUTINELOCATIONS - "Old" location of Macintosh system calls are used. For example, c2pstr
- ; has been moved from Strings to TextUtils. It is conditionalized in
- ; Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
- ; This allows developers to upgrade to newer interface files without suddenly
- ; all their code not compiling becuase of "incorrect" includes. But, it
- ; allows the slow migration of system calls to more understandable file
- ; locations. OLDROUTINELOCATIONS currently defaults to true, but eventually
- ; will default to false.
- ;
- ;
- ; There are some invariants among the conditionals:
- ;
- ; GENERATINGPOWERPC != GENERATING68K
- ; GENERATING68881 => GENERATING68K
- ; GENERATINGPOWERPC => GENERATINGCFM
- ; GENERATINGPOWERPC => CFMSYSTEMCALLS
- ; CFMSYSTEMCALLS => GENERATINGCFM
- ; GENERATINGPOWERPC => SystemSevenOrLater
- ; SystemSevenFiveOrLater => SystemSevenOrLater
- ; SystemSevenOrLater => SystemSixOrLater
- ;
- ;
- ;
- IF &TYPE('PowerAsm') <> 'UNDEFINED' THEN
- GENERATINGPOWERPC: SET 1
- GENERATING68K: SET 0
- ELSE
- GENERATINGPOWERPC: SET 0
- GENERATING68K: SET 1
- ENDIF
- IF &TYPE('GENERATING68881') = 'UNDEFINED' THEN
- GENERATING68881: SET 0
- ENDIF
- IF GENERATINGPOWERPC THEN
- CFMSYSTEMCALLS: SET 1
- GENERATINGCFM: SET 1
- ENDIF
- IF &TYPE('GENERATINGCFM') = 'UNDEFINED' THEN
- IF &TYPE('__CFM68K__') = 'UNDEFINED' THEN
- GENERATINGCFM: SET 0
- CFMSYSTEMCALLS: SET 0
- ELSE
- GENERATINGCFM: SET 1
- CFMSYSTEMCALLS: SET 1
- ENDIF
- ENDIF
- IF &TYPE('CFMSYSTEMCALLS') = 'UNDEFINED' THEN
- CFMSYSTEMCALLS: SET 0
- ENDIF
- IF &TYPE('SystemSevenFiveOrLater') = 'UNDEFINED' THEN
- SystemSevenFiveOrLater: SET 0
- ENDIF
- IF &TYPE('OLDROUTINENAMES') = 'UNDEFINED' THEN
- OLDROUTINENAMES: SET 1
- ENDIF
- IF &TYPE('OLDROUTINELOCATIONS') = 'UNDEFINED' THEN
- OLDROUTINELOCATIONS: SET 1
- ENDIF
- IF &TYPE('SystemSevenOrLater') = 'UNDEFINED' THEN
- IF GENERATINGCFM ++ SystemSevenFiveOrLater THEN
- SystemSevenOrLater: SET 1
- ELSE
- SystemSevenOrLater: SET 0
- ENDIF
- ENDIF
- IF &TYPE('SystemSixOrLater') = 'UNDEFINED' THEN
- SystemSixOrLater: SET SystemSevenOrLater
- ENDIF
- IF OLDROUTINENAMES THEN
- IF &TYPE('USES68KINLINES') = 'UNDEFINED' THEN
- USES68KINLINES: SET GENERATING68K
- ENDIF
- USESCODEFRAGMENTS: SET GENERATINGCFM
- USESROUTINEDESCRIPTORS: SET GENERATINGCFM
- ENDIF
- ENDIF ; __CONDITIONALMACROS__
-